package edu.unc.ils.nlp;

import java.util.Comparator;

import org.apache.commons.collections15.Bag;

class ValueComparator implements Comparator {

	  Bag<String> base;
	  public ValueComparator(Bag<String> base) {
	      this.base = base;
	  }

	  public int compare(Object a, Object b) {

	    if(base.getCount((String)a) < base.getCount((String)b)) {
	      return 1;
	    } else if(base.getCount((String)a) == base.getCount((String)b)) {
	      return 0;
	    } else {
	      return -1;
	    }
	  }
	}

